//
//  Common.swift
//  anxinapp
//
//  Created by iDev on 6/21/17.
//  Copyright © 2017 iDev. All rights reserved.
//

import UIKit
import SnapKit
import Alamofire

//modle?.append( MainProjectModle(PJName: "123", PJMembers: ["456","12"], PJTime: "2014.05.12 - 2015.06.13", PJState:0))
//modle?.append( MainProjectModle(PJName: "456", PJMembers: ["123","456","78"], PJTime: "2014.05.12", PJState:1))
//modle?.append( MainProjectModle(PJName: "789", PJMembers: ["zzk"], PJTime: "2014.05.12", PJState:0))
//modle?.append( MainProjectModle(PJName: "就是这样", PJMembers: ["没人负责"], PJTime: "2014.05.12", PJState:1))
//modle?.append( MainProjectModle(PJName: "无人项目组", PJMembers: ["呵呵"], PJTime: "2014.05.12", PJState:0))
//modle?.append( MainProjectModle(PJName: "测试大量数据", PJMembers: ["哈哈"], PJTime: "2014.05.12", PJState:1))
//modle?.append( MainProjectModle(PJName: "没事干，浪费时间项目", PJMembers: ["没事干的人"], PJTime: "2014.05.12", PJState:0))

var testProjectModle = [["PJID":123,"PJName":"123", "PJMembers":["456","12"], "PJTime":"2014.05.12 - 2015.06.13", "PJState":0],["PJID":213,"PJName":"hello world", "PJMembers":["456","12"], "PJTime":"2014.05.12 - 2015.06.13", "PJState":0],["PJID":444,"PJName":"hehe", "PJMembers":["456","12"], "PJTime":"2014.05.12 - 2015.06.13", "PJState":0]]

var testProjectID = [(123,"123"),(213,"hello world"),(444,"hehe")]

var testDetailModle = [[[("columu_icondate","签订日期","2014/12/31",false),("columu_icondate2","完成日期","2222.12.32",true),("columu_iconman","负责人","黑心老板",true)], [("column_iconnum","合同编号","74110",true),("columu_iconman","机械部分","没人",true),("columu_iconman","代码部分","鬼才去负责",true)],[("columu_icondata","资料","有资料？",true)],[("columu_icondate","签订日期","2015/12/31",false),("columu_icondate2","完成日期","4444.12.32",true),("columu_iconman","负责人","跑路了",true)], [("column_iconnum","合同编号","74110",true),("columu_iconman","不知道这是啥部分","没人",true),("columu_iconman","代码部分","睡觉去了",true)],[("columu_icondata","资料","此处没有资料",true)],[("columu_icondate","没用的日期","2014/12/31",false),("columu_icondate2","完不成了","xxxx.xx.xx",true),("columu_iconman","负责人","不给钱",true)], [("column_iconnum","合同编号","22222",true),("columu_iconman","后台部分","偷偷出国了",true),("columu_iconman","代码部分","加班去了",true)],[("columu_icondata","资料","这个我不知道有啥用",true)],[("columu_icondate","怎么又是签订日期","9999/00/00",false),("columu_icondate2","我宣布完成了","2333333",true),("columu_iconman","没有负责人","爱谁谁",true)], [("column_iconnum","没有卵用的合同编号","666",true),("columu_iconman","机械部分是干啥的","不认识",true),("columu_iconman","代码部分","我是技术不叫代码",true)],[("columu_icondata","没有资料","垃圾！",true)],[("columu_icondate","什么日期？","0000/--/--",false),("columu_icondate2","没有deadline","---／---／---",true),("columu_iconman","不存在的负责人","tan(PI/2)",true)], [("column_iconnum","你几号","999",true),("columu_iconman","机械部分","死了",true),("columu_iconman","代码部分","因为机械吓跑了",true)],[("columu_icondata","诡异的资料","为什么诡异",true)],[("columu_icondate","又是签订日期","rwxr-x---",false),("columu_icondate2","完成日期","我仿佛进入了鬼打墙",true),("columu_iconman","滚吧负责人","真可怕",true)], [("column_iconnum","合同编号又来了","爱多少多少",true),("columu_iconman","机械部分","饿死了",true),("columu_iconman","代码部分","说了我是技术",true)],[("columu_icondata","别再资料了","真没看到资料",true)]],[[("columu_icondate","签订日期","2014/12/31",false),("columu_icondate2","完成日期","2222.12.32",true),("columu_iconman","负责人","黑心老板",true)], [("column_iconnum","合同编号","74110",true),("columu_iconman","机械部分","没人",true),("columu_iconman","代码部分","鬼才去负责",true)],[("columu_icondata","资料","有资料？",true)]],[[("columu_icondate","签订日期","2014/12/31",false),("columu_icondate2","完成日期","2222.12.32",true),("columu_iconman","负责人","黑心老板",true)], [("column_iconnum","合同编号","74110",true),("columu_iconman","机械部分","没人",true),("columu_iconman","代码部分","鬼才去负责",true)],[("columu_icondata","资料","有资料？",true)]]]

var testTemplateModle = [[("columu_icondate","签订日期","选择日期",true),("columu_icondate2","完成日期","选择日期",true),("columu_iconman","负责人","输入姓名",true)], [("column_iconnum","合同编号","74110",true),("columu_iconman","机械部分","没人",true),("columu_iconman","代码部分","鬼才去负责",true)],[("columu_icondata","资料","有资料？",true)]]

let SCREENHEIGHT = UIScreen.main.bounds.height
let SCREENWIDTH = UIScreen.main.bounds.width

let TEXTGREEN = UIColor(red: 56/255.0, green: 124/255.0, blue: 124/255.0, alpha: 1)

var firstRespondView:UIView? // 记录第一响应者

enum ProjectMode {
    case view
    case edit
    case add
}

let APIURL = "http://xmgg.zzkshare.top:8989/test/public/"

let kNSDefaultIsLogin = "knsdefaultislogin"
let kNSDefaultUsername = "knsdefaultuser"
let kNSDefaultPwd = "knsdefaultupwd"

func HasCommonNetWorkError(response: DefaultDataResponse)->Data?{
    if response.error != nil {
        //            print(response.error)
        return nil
    }
    guard let data = response.data, let response = response.response else{
        return nil
    }
    if response.statusCode != 200 {
        return nil
    }
    return data
}

